package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.Remunerationasc;
import com.gljx.web.dao.RemunerationascMapper;
import com.gljx.web.service.RemunerationascService;

@Service
@Transactional
public class RemunerationascServiceImpl implements RemunerationascService {
	
	@Autowired
	private RemunerationascMapper remunerationascMapper;
	/**
	 * 根据组织查找定薪定级信息
	 */
	@Override
	public List<Remunerationasc> queryRemunerationascByCompanyId(String fcompanyId) {
		// TODO Auto-generated method stub
		return remunerationascMapper.selectRemunerationasc(fcompanyId);
	}
	/**
	 * 查找编码最大定薪定级信息
	 */
	@Override
	public String selectFnumber(String companyId) {
		// TODO Auto-generated method stub
		return remunerationascMapper.selectFnumber(companyId);
	}
	/**
	 * 赠加定薪定级信息
	 */
	@Override
	public int addRemunerationasc(Remunerationasc remunerationasc) {
		// TODO Auto-generated method stub
		return remunerationascMapper.insertSelective(remunerationasc);
	}
	/**
	 * 根据fid删除
	 */
	@Override
	public int deleteByPrimaryKey(String fid) {
		// TODO Auto-generated method stub
		return remunerationascMapper.deleteByPrimaryKey(fid);
	}
	/**
	 * 根据fid查找定薪定级信息
	 */
	@Override
	public Remunerationasc selectRemunerationascByFid(String fcompanyId, String fid) {
		// TODO Auto-generated method stub
		return remunerationascMapper.selectRemunerationascByFid(fcompanyId, fid);
	}
	/**
	 * 根据fid修改定薪定级信息
	 */
	@Override
	public int updateRemunerationascByFid(Remunerationasc remunerationasc) {
		// TODO Auto-generated method stub
		return remunerationascMapper.updateByPrimaryKeySelective(remunerationasc);
	}
	/**
	 * 根据名称查找
	 */
	@Override
	public List<Remunerationasc> selectRemunerationascByName(String fnameL2, String companyId) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("fnameL2", fnameL2);
		map.put("fid", companyId);
		return remunerationascMapper.selectRemunerationascByName(map);
	}

}
